<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>机动车档案详情审核</title>
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/easyui_my.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/css.css" />

<script type="text/javascript" src="${ctx}/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/js/common.js"></script>
</head>
<script type="text/javascript"> 
/* <li onClick="a_click(this.id)" id="fileNameType0"><a href="#fileNameType00" id="fileNameType00">全部</a></li>
<li onClick="a_click(this.id)" id="fileNameType1" class="hoveraddclass"><a href="#fileNameType11" id="fileNameType11">业务申请表</a></li>	
<li onClick="a_click(this.id)" id="fileNameType2"><a href="#fileNameType21" id="fileNameType12">所有人身份证明</a></li>	
<li onClick="a_click(this.id)" id="fileNameType3"><a href="#fileNameType31" id="fileNameType13">机动车来历凭证</a></li>	
<li onClick="a_click(this.id)" id="fileNameType4"><a href="#fileNameType41" id="fileNameType14">机动车检查记录表</a></li>
<li onClick="a_click(this.id)" id="fileNameType5"><a href="#fileNameType51" id="fileNameType15">合格证或进口说明书</a></li>
<li onClick="a_click(this.id)" id="fileNameType6"><a href="#fileNameType61" id="fileNameType16">机动车交强险凭证</a></li>	
<li onClick="a_click(this.id)" id="fileNameType7"><a href="#fileNameType71" id="fileNameType17">购置税</a></li> */
var jsonstr="[]";  
var jsonarray = eval('('+jsonstr+')'); 

$(function(){
	var htmlFlagArea="";
	var htmlPicArea = "";
	//循环列表,加载第一个档案类型所有图片
	<c:forEach items="${listTpurl}" var="obj" varStatus="status">
	
	var Ocxid="playOcx"+${status.count};
	 if("${status.count}"=="1"){
      var PicAddrEncrypt = "${obj.singleIpaddress}";
	  htmlPicArea +="<object id=\""+Ocxid+"\" classid=\"clsid:BCB28301-A827-4DE4-BA67-623FAC960893\" width=\"100%\" height=\"99%\"></object>";
	  htmlFlagArea+="<li onClick=\"a_click(this.id)\" id=\"fileNameType"+${status.count}+"\" class=\"hoveraddclass\"><a href=\"#\" id=\"fileNameType1"+${status.count}+"\">档案"+${status.count}+"</a></li>";
	 }else{
		  htmlFlagArea+="<li onClick=\"a_click(this.id)\" id=\"fileNameType"+${status.count}+"\" ><a href=\"#\" id=\"fileNameType1"+${status.count}+"\">档案"+${status.count}+"</a></li>";
	 }
	//生成json数组
	var formdata = {  
            "orderId" : "fileNameType"+"${status.count}",  
            "singleIpaddress" : "${obj.singleIpaddress}"
        };
    jsonarray.push(formdata);
	</c:forEach>
	htmlFlagArea+="<li onClick=\"a_click(this.id)\" id=\"fileNameType8\" ><a href=\"#\" id=\"fileNameType18\">全部</a></li>";
	$("#TableDatatp2").append(htmlPicArea);
	$("#flagLi").append(htmlFlagArea);
	document.getElementById("playOcx1").ImageUrl = PicAddrEncrypt;
 /*    <c:forEach items="${tpNums}" var="mapObj" varStatus="status">
   	    if("${mapObj.key}"=='8'){
			$("#fileNameType0"+"${mapObj.key}").text('全部['+"${mapObj.value}"+'张]');
   	    }else if("${mapObj.key}"=='1'){
		 	$("#fileNameType1"+"${mapObj.key}").text('业务申请表['+"${mapObj.value}"+'张]');
		}else if("${mapObj.key}"=='2'){
			$("#fileNameType1"+"${mapObj.key}").text('身份证明['+"${mapObj.value}"+'张]');
		}else if("${mapObj.key}"=='3'){
			$("#fileNameType1"+"${mapObj.key}").text('来历凭证['+"${mapObj.value}"+'张]');
		}else if("${mapObj.key}"=='4'){
			$("#fileNameType1"+"${mapObj.key}").text('检查记录表['+"${mapObj.value}"+'张]');
		}else if("${mapObj.key}"=='5'){
			$("#fileNameType1"+"${mapObj.key}").text('合格证或进口说明书['+"${mapObj.value}"+'张]');
		}else if("${mapObj.key}"=='6'){
			$("#fileNameType1"+"${mapObj.key}").text('交强险凭证['+"${mapObj.value}"+'张]');
		}else if("${mapObj.key}"=='7'){
			$("#fileNameType1"+"${mapObj.key}").text('购置税['+"${mapObj.value}"+'张]');
		}
	</c:forEach>  */
	
});


function a_click(o){
	$(".anniuyanshid li").removeClass("hoveraddclass");
	$("#"+o).addClass("hoveraddclass");
	showPic(o);
}

//根据文件类型id显示相应的档案图片
function showPic(id){
	$("#TableDatatp2").empty();
	for(var i=0;i<jsonarray.length;i++){	
		if(jsonarray[i].orderId==id){
			var Ocxid="playOcx"+i;
			htmlPicArea="";
			htmlPicArea +="<object id=\""+Ocxid+"\" classid=\"clsid:BCB28301-A827-4DE4-BA67-623FAC960893\" width=\"100%\" height=\"99%\"></object>";
			$("#TableDatatp2").append(htmlPicArea);
			//document.getElementById(Ocxid).BindImage(url, 1);
			document.getElementById(Ocxid).ImageUrl = jsonarray[i].singleIpaddress;
			//document.getElementById(Ocxid).WaterImage();
		}else if(id=="fileNameType8"){
			var Ocxid="playOcx"+i;
			htmlPicArea="";
			htmlPicArea +="<object id=\""+Ocxid+"\" classid=\"clsid:BCB28301-A827-4DE4-BA67-623FAC960893\" width=\"100%\" height=\"99%\"></object>";
			$("#TableDatatp2").append(htmlPicArea);
			document.getElementById(Ocxid).ImageUrl = jsonarray[i].singleIpaddress;
		}
	}
}
</script>
<body class="easyui-layout">
	<div data-options="region:'east',border:false" id="TableDatatp1" style="width:300px; background:#f0f0f0;border-left: 1px solid #d2d2d2;">
	<div style="margin: 10px 9px 0;">
	<table cellspacing="0" cellpadding="0" border="0" width="100%" class="dananguanglikuang100">	     
				<tr>
		             <th align="right" height="28" width="100" class="xinjyangshilaiddf1">流水号：</th>
		             <td class="xinjyangshilaiddf1">
		                 <a id="lsh">${info.lsh }</a>
		             </td>
		         </tr>
		     	 <tr>
		             <th align="right" height="28" class="xinjyangshilaiddf2">号牌号码：</th>
		             <td class="xinjyangshilaiddf2">
		                <a id="hphmmc">${info.hphmmc }</a>
		             </td>
		         </tr>
		         <tr>
		             <th align="right" height="28" class="xinjyangshilaiddf1">车辆品牌：</th>
		             <td class="xinjyangshilaiddf1">
		                 <a id="clpp1">${info.clpp1 }</a>
		             </td>
		         </tr>
		         <tr>
		             <th align="right" height="28" class="xinjyangshilaiddf2">号牌种类：</th>
		             <td class="xinjyangshilaiddf2">
		                 <a id="hpzl">${info.hpzlmc }</a>
		             </td>
		             </tr>
		     	 <tr>
		             <th align="right" height="28" class="xinjyangshilaiddf1">车辆颜色：</th>
		             <td class="xinjyangshilaiddf1">
		                 <a id="csys">${info.csysmc }</a>
		             </td>
		         </tr>
		         <tr>
		              <th align="right" height="28" class="xinjyangshilaiddf2">车辆识别编号：</th>
		             <td class="xinjyangshilaiddf2">
		           	     <a id="clsbdh">${info.clsbdh }</a>
		             </td>
		         </tr>
		         <tr>
		             <th align="right" height="28" class="xinjyangshilaiddf1">发动机编号：</th>
		             <td class="xinjyangshilaiddf1">
		                <a id="fdjh">${info.fdjh }</a>
		             </td>
		         </tr>
		         <tr>
		             <th align="right" height="28" class="xinjyangshilaiddf2">所有人：</th>
		             <td class="xinjyangshilaiddf2">
		                 <a id="syr">${info.syr }</a>
		             </td>
		         </tr>
		    </table>
		    <div style="height: 60px; padding: 0 0px 0 0;">
		   		 <input type="hidden" id="applyNo" value=${applyNo }>
		    	 <a href="#" zt="1" name="audit" style=" float: right;margin:12px;" class="sousuocx">审核通过</a>
                 <a href="#" zt="2" name="audit" style=" float: right;margin:12px;" class="sousuocx">审核不通过</a>
                 <input type="hidden" id="currentXh" value="${info.xh}"/>
          <%--     <div class="diyipaidhusnfhenfnf1" style="margin:2px;">
					    <c:choose>
	                        <c:when test="${nextXh ne '0'}"> 
	                         <a href="#" style=" float: right; margin: 0 27px 0 0 ;" class="congzhim" onClick="javascript :pageJump('${nextXh }','pageDown');" style="visibility: visible;">下一条</a>
	                        </c:when>
	                        <c:otherwise>
	                            <a href="#" style=" float: right; margin: 0 27px 0 0 ;" class="congzhim">下一条</a>
	                        </c:otherwise>   
	                    </c:choose>
	                    <c:choose>
	                        <c:when test="${preXh ne '0'}"> 
	                            <a href="#" class="congzhim" style=" float: right; margin: 0 8px 0 0 ;" onClick="javascript :pageJump('${preXh}','pageUp');" style="visibility: visible;">上一条</a>
	                        </c:when>
	                        <c:otherwise>
	                            <a href="#" style=" float: right; margin: 0 8px 0 0 ;" class="congzhim1">上一条</a>
	                        </c:otherwise> 
                       </c:choose>
                       <a id="saveId" href="#" style=" float: right; margin: 0 9px 0 0 ;" class="congzhim" onClick="javascript:VerifyAndSave();" style="visibility: visible;">确认审核</a>
	          </div>  --%>
         </div>
		    </div>		
		    
		    
	<div class="anniujiheti">	    
		<ul class="anniuyanshid" id="flagLi">
		    
		</ul>
		<!-- <dl class="fangdasuoxiaodan">
			<dd><a href="###">放大</a></dd>
			<dd><a href="###">缩小</a></dd>
		</dl> -->		
	</div>      
	</div>
	<div data-options="region:'center',border:false" id="TableDatatp2">
	
	</div>


</body>

<script type="text/javascript">
//审核事件(单个审核)
$('a[name=audit]').unbind('click').bind('click',function(){
    var $this=$(this);
   // var applyNo=$this.attr('applyNo');//申请编号
    var applyNo=$("#applyNo").val();
    var zt=$this.attr('zt');//状态
    var message=$this.text();
    if(confirm('确认执行'+message+'操作?')){
        $.ajax({
            type:'post',
            url:'${ctx}/audit/auditApply.htm',
            data:{
               applyNo:applyNo,
               zt:zt
            },
            success:function(data){
                debugger;
                if(data=='01'){
                    alert('审核成功');
                }
              
            }
       });
    }else{
        return false;
    }
});

</script>